/**
 * @计算字符串中的数组个数
 *
 * @author	 wangshikun <wangshikun2010@gmail.com>
 * @copyright	(c) 2012 wangshikun <wangshikun2010@gmail.com>
 * @license	http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package	default
 * @subpackage	default
 */

#include <stdio.h>
#include <cs50.h>

int stringLength(const char string[]);

int main(int argc, char *argv[]) {
	const char word1[] = {'w', 'a', 'n', 'g', '\0'};
	const char word2[] = {'s', 'h', 'i', '\0'};
	const char word3[] = {'k', 'u', 'n', '\0'};

	printf("string one length is: %d\n", stringLength(word1));
	printf("string two length is: %d\n", stringLength(word2));
	printf("string three length is: %d\n", stringLength(word3));

	return 0;
}

int stringLength(const char string[]) {
	int count = 0;

	while (string[count] != '\0') {
		count++;
	}

	return count;
}
